# -*- coding:utf-8 -*-
#GB/T 95-2002
pd = {'5' : 1,   '6' : 1.6,  '8' : 1.6,
      '10': 2,   '12': 2.5,  '16': 3,
      '20': 3,   '24': 4,    '30': 4,
      '36': 5,   '42': 8,    '48': 8}

#GB/T 93-1987
td = {'5' : 1.3, '6' : 1.6,  '8' : 2.1,
      '10': 2.6, '12': 3.1,  '16': 4.1,
      '20': 5,   '24': 6,    '30': 7.5,
      '36': 9,   '42': 10.5, '48': 12}

#GB/T 41-2000
lm = {'5' : 5.6, '6' : 6.4,  '8' : 7.9,
      '10': 9.5, '12': 12.2, '16': 15.9,
      '20': 19,  '24': 22.3, '30': 26.4,
      '36': 31.9,'42': 34.9, '48': 38.9}

di_bolt = raw_input('bolt diameter(ie, 20): ')
num_lm  = raw_input('nut number(1/2): ')
num_pd  = raw_input('plain washers number(1/2): ')
num_td  = raw_input('single coil spring lock washers number (1/2): ')

if num_lm == '':
    num_lm = 1
if num_pd == '':
    num_pd = 1  
if num_td == '':
    num_td = 1

len_bolt = num_lm * lm[di_bolt] + num_pd * pd[di_bolt] + num_td * td[di_bolt]

print "lm + pd + td: ", len_bolt
